Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed accessing optional properties through reflection #204

Merged
merged 1 commit into from
Apr 5, 2018

Conversation

ilyapuchka
Copy link
Collaborator

Resolves #110 (comment)
When getting descendant that represents optional property casting it to Optional will just wrap it in another optional, so instead we use a custom protocol that only Optional implements and that provides unwrapped value or returns nil. If property is not optional we will just return its value.

@djbe
Copy link
Contributor

djbe commented Mar 25, 2018

That was quick 👍

@djbe
Copy link
Contributor

djbe commented Mar 25, 2018

I've tested it locally and can confirm this fixes the issue 🎉

@ilyapuchka ilyapuchka requested a review from kylef March 25, 2018 21:49
djbe added a commit to SwiftGen/SwiftGen that referenced this pull request Mar 27, 2018
@kylef kylef merged commit 8fa0bd2 into master Apr 5, 2018
@kylef kylef deleted the optional-reflection branch April 5, 2018 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants